package net.xiduth.game.player.content.tasks; 
  
import net.xiduth.game.player.Player;
  
/** 
 *  
 * @author Xiles 
 * 
 */
public class TaskSystem { 
      
    public static int TaskBoard = 205; 
   
    public static void TaskBoard(Player player) { 
        if (player.ToggleSystem == true) { 
            /* 
             * Category 
             */
            player.getPackets().sendIComponentText(TaskBoard, 61, "Cooking"); 
            player.getPackets().sendIComponentText(TaskBoard, 57, "Crafting"); 
            player.getPackets().sendIComponentText(TaskBoard, 53, "Resting"); 
            player.getPackets().sendIComponentText(TaskBoard, 49, "Fletching"); 
            player.getPackets().sendIComponentText(TaskBoard, 65, "Task Board"); 
            player.getPackets().sendIComponentText(TaskBoard, 64, "Welcome to the Task Board." + 
                    " Click one of the tasks above to see your progress."); 
        player.getInterfaceManager().sendInterface(TaskBoard); 
    } else { 
        player.sm("You have closed the Task Board."); 
    } 
    } 
    public static void sendCooking(Player player) { 
            player.closeInterfaces(); 
            player.getPackets().sendIComponentText(TaskBoard, 61, "Cooking"); 
            player.getPackets().sendIComponentText(TaskBoard, 57, "Crafting"); 
            player.getPackets().sendIComponentText(TaskBoard, 53, "Resting"); 
            player.getPackets().sendIComponentText(TaskBoard, 49, "Fletching"); 
            /*Title*/
            player.getPackets().sendIComponentText(TaskBoard, 65, "Cooking"); 
            player.getPackets().sendIComponentText(TaskBoard, 64, "Your task is to cook 1500 of any raw item. " + 
                                                             "So far you have cooked "+ player.CookingTask +" items."); 
            player.getInterfaceManager().sendInterface(TaskBoard); 
    }  
    public static void sendCrafting(Player player) { 
        player.closeInterfaces(); 
        player.getPackets().sendIComponentText(TaskBoard, 61, "Cooking"); 
        player.getPackets().sendIComponentText(TaskBoard, 57, "Crafting"); 
        player.getPackets().sendIComponentText(TaskBoard, 53, "Resting"); 
        player.getPackets().sendIComponentText(TaskBoard, 49, "Fletching"); 
        /*Title*/
        player.getPackets().sendIComponentText(TaskBoard, 65, "Crafting"); 
        player.getPackets().sendIComponentText(TaskBoard, 64, "Your Task is to cut 1500 gems. " + 
                "So far you have cut "+ player.GemTask +" Gems."); 
        player.getInterfaceManager().sendInterface(TaskBoard); 
    }  
      
    public static void sendResting(Player player) { 
    player.closeInterfaces(); 
    player.getPackets().sendIComponentText(TaskBoard, 61, "Cooking"); 
    player.getPackets().sendIComponentText(TaskBoard, 57, "Crafting"); 
    player.getPackets().sendIComponentText(TaskBoard, 53, "Resting"); 
    player.getPackets().sendIComponentText(TaskBoard, 49, "Fletching"); 
    /*Title*/
    player.getPackets().sendIComponentText(TaskBoard, 65, "Resting"); 
    player.getPackets().sendIComponentText(TaskBoard, 64, "Your Task is to rest 150 times. " + 
            "So far you have rested "+ player.RestTask +" times"); 
    player.getInterfaceManager().sendInterface(TaskBoard); 
    }  
  
    public static void sendFletching(Player player) { 
    player.closeInterfaces(); 
    player.getPackets().sendIComponentText(TaskBoard, 61, "Cooking"); 
    player.getPackets().sendIComponentText(TaskBoard, 57, "Crafting"); 
    player.getPackets().sendIComponentText(TaskBoard, 53, "Resting"); 
    player.getPackets().sendIComponentText(TaskBoard, 49, "Fletching"); 
    /*Title*/
    player.getPackets().sendIComponentText(TaskBoard, 65, "Fletching"); 
    player.getPackets().sendIComponentText(TaskBoard, 64, "Your task is to fletch 2000 items. " + 
            "So far you have fletched "+ player.FletchingTask +" items."); 
    player.getInterfaceManager().sendInterface(TaskBoard); 
    }
    
     public static void handleButtons(Player player, int componentId) { 
          if (componentId == 49) {   
                sendFletching(player); 
                } 
          if (componentId == 57) {   
                sendCrafting(player); 
                } 
          if (componentId == 53) {   
                sendResting(player); 
                } 
            if (componentId == 61) {     
                sendCooking(player); 
            } 
     } 
  
      
} 